﻿#ifndef CCamerCtrMange_H
#define CCamerCtrMange_H
/********************************************************************************
** @ Date:2025/04/29
** @ Author: HanJiaXin
** @ Description:视屏控制类
** @ Version:1.0.0
** @ ClassName:CCamerCtrMange
** @ Fun:
********************************************************************************/
#include <QThread>
#include <atomic>
#include "CDevDataCam.h"
#include "CCamerSdkOper.h"

class CCamerCtrMange  : public QThread
{
	Q_OBJECT

public:
	CCamerCtrMange(CDevDataCam *pDevDataCam);
	~CCamerCtrMange();
	void ThreadStart();
	void ThreadStop();
	bool CtrDevice(SCtrInfo &stCtrInfo);//Modifywxy 改成引用
	bool CtrDeviceEx(SCtrInfo stCtrInfo);

private:
	bool ctrDeviceMy(SCtrInfo &stCtrInfo);           //类自己的控制命令函数
	bool login(SCtrInfo& stCtrInfo);		         //登录
	bool realPlay(SCtrInfo& stCtrInfo);              //启动预览 
	bool stopRealPlay(SCtrInfo& stCtrInfo);          //停止预览 
	bool capture(SCtrInfo &stCtrInfo);               //拍照
	bool getImage(SCtrInfo &stCtrInfo);              //获取视频帧
	bool ptzControlOther(SCtrInfo stCtrInfo);		 //控制云台

protected:
	void run() override;

private:
	CDevDataCam *m_pDevDataCam;              //巡检机器人数据类
	QVector<SCtrInfo>m_vecCtrQueue;
	bool m_bShouldStop;			             //线程是否销毁
	bool m_bFrist;                           //是否是首次开启线程，防止重启启动设备的时候频繁创建线程
	std::atomic<bool>      m_bhread;         //线程运行状态
	int m_nCount;
	QMutex   *m_pMutex;
	CCamerSdkOper* m_pCamerSdkOper;          //相机操作类
};
#endif